package net.efo.controller;

import java.sql.SQLException;

import net.efo.model.sqlite.Statements;

/**
 * @author johnydoe
 * 
 */
public class Starter {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		System.out.println("Starting app");
		
		// Creating the models
		DocumentController dc = null;
		TreeController tc = null;
		
		//String location = "/home/johnydoe/School/java-workspace/pkms/db/pkms.db";
		String location = "/Users/jonydoe/Documents/School/workspace/pkms/db/pkms.db";
		
		// Connecting to the sqlite database
		try {
			Statements stmt = new Statements(location);
			dc = new DocumentController(stmt);
			dc.populateModels();
			
			tc = new TreeController(stmt, dc);
			
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		// Creating the view
		MainViewConroller mvc = new MainViewConroller(dc);
		mvc.buildView();
		System.out.println("App started");
	}
}
